home *** CD-ROM | disk | FTP | other *** search
-
- /* RptToRep.Prg - Report Converter Wizard for Visual dBASE 7
-
- Purpose To convert Crystal 3.0 binary report and label files to
- Visual dBASE 7 Report Classes
-
- Limitations Because of inherent incompatibilities between the workarea-
- oriented DML of Visual dBASE 5.5 and the object-oriented
- data classes in Visual dBASE 7, complex relations, filters
- and keys cannot be converted automatically. To do so would
- require a program that parses the entire dBASE language.
-
- Therefore, the Report Converter Wizard will bring over
- simple single-field relations only. All other relations
- must be hand-coded by the user after conversion.
-
- The Report Wizard provides error messages both onscreen
- and in the header of the target .rep file to indicate
- the areas that the Wizard was unable to convert.
-
- Files: RptToRep.Prg Main startup program for Wizard
- RptToRep.Wfm Main user-interface program. The Wizard Form
- RptToRepConv.cc Main conversion/streaming class
- RptToRepRsc.cc Internationalization Resources
-
-
- Author: A. A. Katz (Ksoft, Inc.) and James Sare
-
- Version: 1.0 10/4/1997
-
- (c) 1997 Borland International, all rights reserved
-
- */
-
- /////////////////////////////Parameters
-
- Param cDefaultFile // Enables Navigator call to Wizard
- cDefaultFile = upper(iif(type('cDefaultFile') = 'C',cDefaultFile,''))
-
-
- /////////////////////////////Load Programs
-
- set proc to program(1) // Load this one to support included class
- set proc to RptToRep.wfm addi
- set proc to RptToRepRsc.cc addi
- set proc to RptToRepConv.cc addi
- set proc to qParse.cc addi
-
- ////////////////////////////Load Help File
-
- cLoadPath = substr(program(1),1,rat('\',program(1)))
-
- if file(cLoadPath+'RptToRep.hlp')
- set help to cLoadPath+'RptToRep.hlp'
- elseif file(_dbwinhome+'help/dBASE.hlp')
- set help to
- endif
-
- /////////////////////////////Instantiate classes
-
- f = new RptToRepForm()
-
- f.Env = new Environment() // Store/Restore environment
- f.oLang = new InternationalText(f) // Internationalization
- f.oQuery = new QParse() // Query Parser
- f.pageno = 1
-
- if not empty(cDefaultFile) // Read in default filenames
- // if sent from Navigator
-
- f.SourcePathField.value := cDefaultFile // Default Source Path
- //
- if at('.RPT',upper(cDefaultFile)) > 0
-
- f.TargetPathField.value := ;
- substr(cDefaultFile,1,at('.RPT',upper(cDefaultFile))-1)+;
- '.REP'
-
- elseif at('.RPL',upper(cDefaultFile)) > 0 // Default Target Path
-
- f.TargetPathField.value := ;
- substr(cDefaultFile,1,at('.RPL',upper(cDefaultFile))-1)+;
- '.LAB'
-
- endif
-
- endif
-
- f.oLang.SetUpStrings() // Sets form text for language
-
-
- //////////////////////////////Open form and start Wizard
- f.ReadModal()
- f.release() // recover resources
-
-
- ///////////////////Class Environment//////////////////////////////
- /* Stores and restores environment present before running
- Report Converter Wizard
-
- Restores environment with Reset() method call
- Syntax:
- form.oEnv = New Environment()
- form.oEnv.reset()
- */
-
-
- Class Environment
-
- this.talk = set('TALK') //Store states to properties
- this.exact = sET('EXACT')
- this.cuaenter = Set('CUAENTER')
-
- Set TALK OFF
- Set EXACT OFF
- Set CUAENTER ON
-
- ///////////////////Method Reset//////////////////////////////////
-
- function reset // Restore environment
- Private cState
-
- cState = this.talk
- Set TALK &cState
-
- cState = this.exact
- Set EXACT &cState
-
- cState = this.cuaenter
- Set CUAENTER &cState
-
- return true
-
- endclass
-